package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person a = new Person();
        try {
            a.setAge(1000);
        }catch (IllegalAgeException e){
            System.out.println(e.getMessage());
        }
        System.out.println("他的年龄为："+a.getAge());
    }
}
